<?php include PATH_TPL."/tpl_header.html" ?>
<script type="text/javascript">
	$(function(){
		$("#course-menu").addClass('in');
	})
</script>

<div class="header">
    <h1 class="page-title">课程管理</h1>
</div>
        
<ul class="breadcrumb">
    <li><a>课程管理</a> <span class="divider">/</span></li>
    <li class="active">可选的课程</li>
</ul>

<div class="container-fluid">
    <div class="row-fluid">
		<div class="btn-toolbar">
		    <!-- <button class="btn" id="downLoadBtn">导出</button> -->
		</div>
		<div class="well">
			<form method="post" action="<?php echo SITE_ROOT?>student/selectCourse">
		    <table class="table">
		    	<?php if (!empty($allCourse)) {?>
		      <thead>
		        <tr>
		          <th><?php echo $fieldName['course_id']['comment'] ?></th>
		          <th><?php echo $fieldName['coursename']['comment'] ?></th>
		          <th><?php echo $fieldName['course_description']['comment']?></th>
		          <th><?php echo $fieldName['term']['comment'] ?></th>
		          <th><?php echo $fieldName['credit']['comment'] ?></th>
		          <th><?php echo $fieldName['hours']['comment'] ?></th>
		          <th><?php echo $fieldName['plimit']['comment'] ?></th>
		          <th><?php echo $fieldName['persons']['comment'] ?></th>
		          <th style="width: 100px;">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php foreach ($allCourse as $course) { ?>
		        <tr>
		          <td><?php echo $course['course_id']; ?></td>
		          <td><?php echo $course["coursename"]; ?>
		          </td>
		          <td><abbr title="<?php echo $course['course_description'] ?>" style="font-style: italic">课程描述</abbr></td>
		          <td><?php echo $term[$course['term']]?></td>
		          <td><?php echo $course['credit']?></td>
		          <td><?php echo $course['hours']?></td>
		          <td><?php echo $course['plimit']?></td>
		          <td><?php if($course['plimit']==$course['persons']) echo "<font color='red'>".$course['persons']."</font>"; else echo $course['persons'];?>
		          </td>
		          <td>
					<a><label for="<?php echo $course['course_id']?>">选课</label></a>
		          	<input type="checkbox" name="course[<?php echo $course['course_id']?>]" id="<?php echo $course['course_id']?>" value="<?php echo $course['course_id']?>" />
					</span>
		          </td>
		        </tr>
		        <?php }?>
		        <tr>
		        	<td colspan="5"><i>注：将鼠标移动到“<font color="blue">课程描述</font>”即可看到对应课程的描述详情</i></td>
			        <td colspan="4">
			        	<div class="btn-toolbar pull-right">
						<input type="submit" name="submit" class="btn btn-primary" value="提交">
						</div>
					</td>
				</tr>
		      </tbody>
		      <?php }else{?>
		      <tr><td>暂无可选课程</td></tr>
		      <?php }?>
		    </table>
		    </form>
		</div>
	</div>
</div>
<?php include PATH_TPL."/tpl_sidebar.html" ?>